module.exports = (creator) => {
  return {
    cliOptions: {}, // 命令行参数
    doNotCopyFiles: [], // 不需要拷贝的文件
    templateSource: '', // 模板文件git地址
    templateData: {}, // 模板数据, 默认只有projectName
    prompts: [], // inquirer.prompt(prompts), 数据结果会合并到templateData
    hooks: {
      beforeCreate() {
      },
      finishCreate() {
        console.log('Installing dependencies ...');
        const subprocess = require('child_process').spawn('npm', ['i'], {
          shell: true,
          cwd: creator.targetDir,
          stdio: 'inherit'
        });
        return new Promise(resolve => {
          subprocess.on('error', resolve);
          subprocess.on('close', resolve);
        });
      },
    }
  }
};
